package com.chen.springboot.dto;

import com.chen.springboot.entity.User;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * @Author: Chen
 * @Date: 2024/4/3  14:46
 */

// User的 Data Transfer Object 数据传输转换对象
@Data
public class UserDto {
    private Integer id;
    private String username;
//    private String password;
    private String nickName;
    private Integer age;
    private String avatar;
    private String sex;
    private int role;
    private String token;
    private String email;
    private String address;

//    private LocalDateTime createTime;
    private String createTime;
    public UserDto(User user, String token) {
        this.id = user.getId();
        this.username = user.getUsername();
//        this.password = user.getPassword();
        this.nickName = user.getNickName();
        this.age = user.getAge();
        this.avatar = user.getAvatar();
        this.email = user.getEmail();
        this.address = user.getAddress();
        this.createTime = user.getCreateTime();
        this.sex = user.getSex();
        this.role = user.getRole();
        this.token = token;

    }
}
